﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Ent.Inscripcion.Presentacion.Default" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Pagina de Inicio</title>
    
    <link href="Resources/css/bubble.css" rel="stylesheet" type="text/css" />
    <link href="Resources/css/principal.css" rel="stylesheet" type="text/css" />
    
</head>
<body>
    <ext:ResourceManager runat="server" />
    <ext:Viewport runat="server" Layout="border">
        <Items>
            <ext:GroupTabPanel ID="GroupTabPanel1" runat="server" Region="Center" TabWidth="130"
                ActiveGroupIndex="0">
                <Groups>
                    <ext:GroupTab runat="server" MainItem="0">
                        <Items>
                            <ext:Panel runat="server" Title="Horarios" Layout="fit" Icon="CalendarStar" Padding="10">
                                <AutoLoad Url="http://www.utpl.edu.ec/resecnewgeneration/">
                                </AutoLoad>
                            </ext:Panel>
                            <ext:Panel ID="pnlTutorias" runat="server" Title="Horario Tutorías" Layout="fit" Icon="CalendarStar"
                                TabTip="Listado de horarios de las tutorias para el presente periodo académico"
                                Padding="10" AutoScroll="true">
                                <TopBar>
                                    <ext:Toolbar runat="server">
                                        <Items>
                                            <ext:ToolbarFill runat="server" />
                                            <ext:Button ID="Button1" runat="server" Text="Imprimir" Icon="Printer" OnClientClick="window.print();" />
                                        </Items>
                                    </ext:Toolbar>
                                </TopBar>
                                <Items>
                                    <ext:DataView ID="DataView1" runat="server" SingleSelect="true" ItemSelector="tr.customer-record"
                                        OverClass="cust-name-over" EmptyText="No customers to display">
                                        <Store>
                                            <ext:Store ID="stoTutorias" runat="server">
                                                <Reader>
                                                    <ext:JsonReader>
                                                        <Fields>
                                                            <ext:RecordField Name="Nivel" />
                                                            <ext:RecordField Name="Horarios" IsComplex="true" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <Template ID="Template1" runat="server">
                                            <Html>
                                                <div id="customers-ct">
					<div class="header">
						<p>Horarios de Tutorías</p>                                                                        
					</div>
					<table>
						<tr>
                        <th><center>Nivel</center></th>
							<th><center>Lunes</center></th>
							<th><center>Martes</center></th>
							<th><center>Miercoles</center></th>
							<th><center>Jueves</center></th>
							<th><center>Viernes</center></th>
							<th><center>Sabado</center></th>
						</tr>
					
						<tpl for=".">
								<tr>
									<td class="letter-row" colspan="6">
										<div><h2 class="letter-selector">{Nivel}</h2></div>
									</td>
								</tr>
                                
								<tpl for="Horarios">
									<tr class="customer-record l-{parent.Nivel}">
										<td>{parent.Nivel}</td>
                                        <td><center> {HoraInicioL}&nbsp;-&nbsp;{HoraFinL}<br />
                                        {AulaL}<br />
                                        {ParaleloL}</center>
                                        </td>
										<td><center>{HoraInicioM}&nbsp;-&nbsp;{HoraFinM}<br />
                                        {AulaM}<br />
                                        {ParaleloM}</center>
                                        </td>
										<td><center>{HoraInicioMi}&nbsp;-&nbsp;{HoraFinMi}<br />
                                        {AulaMi}<br />
                                        {ParaleloMi}</center>
                                        </td>
										<td><center>{HoraInicioJ}&nbsp;-&nbsp;{HoraFinJ}<br />
                                        {AulaJ}<br />
                                        {ParaleloJ}</center>
                                        </td>
										<td><center>{HoraInicioV}&nbsp;-&nbsp;{HoraFinV}<br />
                                        {AulaV}<br />
                                        {ParaleloV}</center>
                                        </td>
                                        <td><center>{HoraInicioS}&nbsp;-&nbsp;{HoraFinS}<br />
                                        {AulaS}<br />
                                        {ParaleloS}</center>
                                        </td>
									</tr>
								</tpl>
						</tpl>                    
					</table>
				</div>
                                            </Html>
                                        </Template>
                                        <Listeners>
                                            <ContainerClick Fn="viewClick" />
                                        </Listeners>
                                    </ext:DataView>
                                </Items>
                                
                            </ext:Panel>
                            <ext:Panel ID="pnlExamenes" runat="server" Title="Horario Exámenes" TabTip="Listado de horarios de Exámenes"
                                Layout="fit" Icon="CalendarStar" Padding="10" AutoScroll="true">
                                <TopBar>
                                    <ext:Toolbar ID="Toolbar1" runat="server">
                                        <Items>
                                            <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                                            <ext:Button ID="Button2" runat="server" Text="Imprimir" Icon="Printer" OnClientClick="window.print();" />
                                        </Items>
                                    </ext:Toolbar>
                                </TopBar>
                                <Items>
                                    <ext:DataView ID="DataView2" runat="server" SingleSelect="true" ItemSelector="tr.customer-record"
                                        OverClass="cust-name-over" EmptyText="No customers to display">
                                        <Store>
                                            <ext:Store ID="stoExamenes" runat="server">
                                                <Reader>
                                                    <ext:JsonReader>
                                                        <Fields>
                                                            <ext:RecordField Name="Nivel" />
                                                            <ext:RecordField Name="Horarios" IsComplex="true" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <Template ID="Template2" runat="server">
                                            <Html>
                                                <div id="customers-ct">
					<div class="header">
						<p>Horarios de Exámenes</p>                                                                        
					</div>
					<table>
						<tr>
                        <th><center>Nivel</center></th>
							<th><center>Lunes</center></th>
							<th><center>Martes</center></th>
							<th><center>Miercoles</center></th>
							<th><center>Jueves</center></th>
							<th><center>Viernes</center></th>
							<th><center>Sabado</center></th>
						</tr>
					
						<tpl for=".">
								<tr>
									<td class="letter-row" colspan="6">
										<div><h2 class="letter-selector">{Nivel}</h2></div>
									</td>
								</tr>
                                
								<tpl for="Horarios">
									<tr class="customer-record l-{parent.Nivel}">
										<td>{parent.Nivel}</td>
                                        <td><center> {HoraInicioL}&nbsp;-&nbsp;{HoraFinL}<br />
                                        {AulaL}<br />
                                        {ParaleloL}<br />
                                        {DocenteL}</center>
                                        </td>
										<td><center>{HoraInicioM}&nbsp;-&nbsp;{HoraFinM}<br />
                                        {AulaM}<br />
                                        {ParaleloM}<br />
                                        {DocenteM}</center>
                                        </td>
										<td><center>{HoraInicioMi}&nbsp;-&nbsp;{HoraFinMi}<br />
                                        {AulaMi}<br />
                                        {ParaleloMi}<br />
                                        {DocenteMi}</center>
                                        </td>
										<td><center>{HoraInicioJ}&nbsp;-&nbsp;{HoraFinJ}<br />
                                        {AulaJ}<br />
                                        {ParaleloJ}<br />
                                        {DocenteJ}</center>
                                        </td>
										<td><center>{HoraInicioV}&nbsp;-&nbsp;{HoraFinV}<br />
                                        {AulaV}<br />
                                        {ParaleloV}<br />
                                        {DocenteV}</center>
                                        </td>
                                        <td><center>{HoraInicioS}&nbsp;-&nbsp;{HoraFinS}<br />
                                        {AulaS}<br />
                                        {ParaleloS}<br />
                                        {DocenteS}</center>
                                        </td>
									</tr>
								</tpl>
						</tpl>                    
					</table>
				</div>
                                            </Html>
                                        </Template>
                                        <Listeners>
                                            <ContainerClick Fn="viewClick" />
                                        </Listeners>
                                    </ext:DataView>
                                </Items>
                            </ext:Panel>
                        </Items>
                        <%--<Listeners>
                        <TabChange Handler="manejarClickTab(el,tab);" />
                        </Listeners>--%>
                    </ext:GroupTab>
                    <ext:GroupTab runat="server">
                        <Items>
                            <ext:Panel ID="Panel3" runat="server" Title="Acceso" Layout="fit" Icon="CalendarStar"
                                Padding="10">
                                <Items>
                                </Items>
                            </ext:Panel>
                            <ext:Panel ID="Panel4" runat="server" Title="Estudiantes" Layout="fit" Icon="StatusOnline"
                                TabTip="Acceso al sitio de estudiantes" Padding="10">
                                <Items>
                                    <ext:LinkButton ID="LinkButton1" runat="server" Text="Ir al sitio de estudiantes">
                                        <Listeners>
                                            <Click Handler="document.location = 'Login.aspx';" />
                                        </Listeners>
                                    </ext:LinkButton>
                                </Items>
                            </ext:Panel>
                            <ext:Panel ID="Panel5" runat="server" Title="Administracion" TabTip="Acceso a la administración del sistema"
                                Layout="fit" Icon="UserKey" Padding="10">
                                <Items>
                                    <ext:LinkButton ID="LinkButton2" runat="server" Text="Ir al sitio de Administrador">
                                        <Listeners>
                                            <Click Handler="document.location = 'Administracion/Login.aspx';" />
                                        </Listeners>
                                    </ext:LinkButton>
                                </Items>
                            </ext:Panel>
                        </Items>
                    </ext:GroupTab>
                </Groups>
            </ext:GroupTabPanel>
            <ext:Panel ID="pnlRequisitos" runat="server" Region="East" Width="200" Collapsible="true"
                BaseCls="x-bubble" Frame="true">
                <Items>
                <ext:DataView ID="DataView3" runat="server" SingleSelect="true" ItemSelector="tr.customer-record"
                                        OverClass="cust-name-over" EmptyText="No customers to display">
                    <Store>
                        <ext:Store ID="stoRequisitos" runat="server">
                            <Reader>
                                <ext:JsonReader>
                                    <Fields>
                                        <ext:RecordField Name="Tipo" />
                                        <ext:RecordField Name="Requisitos" IsComplex="true" />
                                    </Fields>
                                </ext:JsonReader>
                            </Reader>
                        </ext:Store>
                    </Store>
                    <Template ID="Template3" runat="server">
                        <Html>
                            <div id="customers-ct">
					            <div class="header">
						            <p>Requisitos</p>                                                                        
					            </div>
					            <table>				
						            <tpl for=".">
								        <tr>
									        <td class="letter-row" colspan="6">
										        <div><h1 class="letter-selector">{Tipo}</h1></div>
									        </td>
								        </tr>
                                
								        <tpl for="Requisitos">
									        <tr class="customer-record l-{parent.Tipo}">
                                                <td> 
                                                {Requisito}<br />
                                                </td>
										
									        </tr>
								        </tpl>
						            </tpl>                    
					            </table>
				            </div>
                        </Html>
                    </Template>
                    <Listeners>
                        <ContainerClick Fn="viewClick" />
                    </Listeners>
                </ext:DataView>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Viewport>
    <%--<ext:XScript ID="XScript1" runat="server">--%>
    <script type="text/javascript">
        var template = '<span style="color:{0};">{1}</span>';
        var manejarClickTab = function (v, tab) {
            if (tab.id == 'pnlTutorias' || tab.id == 'pnlExamenes') {
                pnlRequisitos.collapse(Ext.Component.DIRECTION_RIGHT, true);
            }
            else {
                pnlRequisitos.collapse(Ext.Component.DIRECTION_LEFT, false);
            }
        };
        var change = function (value) {
            return String.format(template, (value > 0) ? "green" : "red", value);
        };

        var pctChange = function (value) {
            return String.format(template, (value > 0) ? "green" : "red", value + "%");
        };

        var viewClick = function (dv, e) {
            var group = e.getTarget("h2.letter-selector");

            if (group) {
                Ext.fly(group).up("div").toggleClass("collapsed");
                Ext.select("#customers-ct tr.l-" + group.innerHTML).toggleClass("collapsed");
            }
        };
    </script>
   <%-- </ext:XScript>--%>
</body>
</html>
